|
Replace Text |
Declaration |
<AMREPLACE TEXT="test" FIND="test" REPLACE="test" RESULTVARIABLE="text [variable name]" USERE="YES" USECASE="YES" INDEX="6" MAXMATCHES="6" TOTALMATCHESVAR="text [variable name]"> |
See Also |
Finds and replaces each or every occurrence of a text pattern and places the result into a variable. Regular expressions may be used for added power and flexibility.
Used to find and replace a word or phrase inside of a larger piece of text .
Specifies target text to be searched.
Specifies the text to search for.
Specifies the text to replace the found text with.
Specifies whether the search performed should be case sensitive.
Specifies whether the FIND parameter is a regular expression. If the option is no, the Find parameter contains literal text, if the option is yes, the find parameter contains a regular expression.
Specifies the variable to receive the new text.
Specifies target text to be searched.
Specifies the maximum number of replacements that should be made. If 0(default) is specified, all instances of the found text will be replaced.
Specifies the variable to receive the total number of replacements that were made.
Using Variables
All variables must be created before they can be used. This is done using
the Create
Variable <AMVARIABLE>
action. Once created, variables can be set using the Set
Variable <AMSET> action, or by certain actions that support
populating variables. To get data out of the variables, in any action
parameter, simply surround the variable name with percentage % signs (e.g.
%varname%). Remember not to use percentage signs when specifying
the name of a variable to populate, percentage signs are only needed to
get data out.
Standard Error Handling Options
This action also includes the standard "Error Causes" and "On
Error" failure handling options/tabs
More on Error Handling Options
Variables and Expressions
All text fields allow the use of expressions by surrounding the expression
in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help
construct these expressions, a popup expression builder is available in
all these fields by pressing F2.
More on variables...
More on expressions...
More on the expression builder...
<AMVARIABLE NAME="sourcedata">AutoMate Version
5.5 Adds Power, Speed, Flexibility and Intelligence.</AMVARIABLE>
<AMVARIABLE NAME="newdata"></AMVARIABLE>
<AMREPLACE TEXT="%sourcedata%" FIND="Speed" REPLACE="Good
Looks" RESULTVARIABLE="newdata">
<AMMESSAGEBOX>BEFORE: %sourcedata%
AFTER: %newdata%</AMMESSAGEBOX>